In a storage area network (SAN) technology, a host is connected to a storage array using a fibre channel (FC), and a storage system provides data storage services to the host.
To improve data stability, a storage system may use two storage arrays. Referring to FIG. 1, there is a storage array 121 and a storage array 123 in a storage system, and the two storage arrays are connected to each other using an FC. When a host writes data to the storage array 121, the storage array 121 not only stores the data into a local storage device, but also sends the data to the storage array 123 for storing. Similarly, data received by the storage array 123 is also sent to the storage array 121 for storing. In this storage manner, the two storage arrays can provide storage services to the host, and same data is stored in the two storage arrays. This is referred to as an active-active storage system. In an active-active storage system, even if one storage array is faulty, a host can also obtain data from the other storage array, therefore improving data security.
Same content is written into the two storage arrays. Therefore, logical address segments of the two storage arrays correspond to each other. To avoid inconsistent data in the two storage arrays, in specific implementation, a global lock is used to ensure mutually exclusive write operations. In a same time period, only one storage array can obtain a write lock of a logical address segment by applying, and only this storage array that has obtained the write lock of the logical address segment can write data to the two storage arrays.
If the storage array 121 has obtained, by applying, a write lock of a logical address segment from a lock server 122, the storage array 123 cannot obtain the write lock, and therefore, cannot write data to a logical address segment corresponding to the storage array 123. The storage array 123 can obtain the write lock only after the write lock is withdrawn by the lock server 122 from the storage array 121.
In a process of withdrawing the write lock, the two storage arrays need to communicate with the lock server 122. After the write lock is withdrawn, the two storage arrays also need to communicate with each other, so that data obtained by the storage array 121 is written to the storage array 123.
The storage array 121 and the storage array 123 are usually far apart, for example, at a distance of 100 km to 300 km. Therefore, in a topology in FIG. 1, the storage array 121 is adjacent to the lock server 122, and a time of communication between the two may be ignored. However, communication between the lock server 122 and the storage array 123 and communication between the storage array 121 and the storage array 123 may take a lot of time. For example, the communication takes several milliseconds each time. If the lock server 122 is moved closer to the storage array 123, although communication between the lock server 122 and the storage array 123 may take a shorter time, communication between the storage array 121 and the lock server 122 may correspondingly take a longer time.
Therefore, in a long-distance active-active system, how to reduce a total time of communication among a lock server and two storage arrays is a problem that needs to be resolved.